Hi Team, I have created a formal module, where I need to rename that module as per user's input. I have write a code for same, but that is not updating. I am getting below error :
-E- DXL: <Line:752> incorrect arguments for function (rename)
Kindly help me out.
string NameFull = "FS-Goal Module"
string descriptionOfFGoals = "Description of FS-Goal Module"
int iAbsNoStart = 1
current = fCurrent
Module modCreated = create(NameFull, descriptionOfFGoals, iAbsNoStart, true)
save (modCreated)
close (modCreated)
string srename = "FS-Goal-" sFSOINo ""
rename(NameFull, srename)
string mRname = edit(srename, false)
mRname."Prefix" = "FS-Goal-" sFSOINo
Rahij - Thu Jan 18 11:09:13 EST 2018 |
Re: Rename Module Name Hello Rahij, from the DXL manual, https://www.ibm.com/support/knowledgecenter/SSYQBZ_9.6.1/com.ibm.doors.requirements.doc/topics/dxl_reference_manual.pdf, page 276: string rename({Item i|Folder f|Project p|ModName_ modRef}, string name, string description) Operation Renames the item specified by the first argument to name and associates it with description. The name argument must be an unqualified name. If the user does not have modify access to the item, the call fails. The first form returns a null string on success; otherwise, an error message. Example rename(folder "my folder", "public", "for review")
So,, these lines should work (did not test this)
string result = rename (item NameFull, srename, descriptionOfGoals)
if (!null result) {
warningBox "An error occurred: " result
}
|
Re: Rename Module Name oh, there are more problems, sorry for not having seen them. the edit command does not return a string but a Module (see page 300 of DXL reference manual) WIth this change, the assignment to the Prefix should also work. Don't forget to save and close the module.
Hope this helps, |
Re: Rename Module Name Please try the code like: ----------------------------------------------
string NameFull = "FS-Goal Module3"
Module modCreated = create(NameFull, descriptionOfFGoals, iAbsNoStart, true)
close (modCreated) ---------------------------------------------- Hope it helps. |
Re: Rename Module Name Mike.Scharnow - Thu Jan 18 11:42:42 EST 2018 oh, there are more problems, sorry for not having seen them. the edit command does not return a string but a Module (see page 300 of DXL reference manual) WIth this change, the assignment to the Prefix should also work. Don't forget to save and close the module.
Hope this helps, Hi Mike, As per your inputs, that's working fine. Thank you so much for help.
Regards, Rahij |